﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
/// <summary>
/// Summary description for bzMasterPageBase
/// </summary>
public class bzMasterPageBase:System.Web.UI.MasterPage
{
    //----------------------------------------------------------
    private DataRow _SiteOption = null;
    public DataRow SiteOption { get { return _SiteOption; } }

    private DataRow _Lang = null;
    public DataRow Lang { get { return _Lang; } }

    private string _Act = "";
    public string Act { get { return _Act; } }

    private string _CurrentLang = "VN";
    public string CurrentLang { get { return _CurrentLang; } }



    public void initSiteLang(string sSiteCate, string sSiteNote, string sLangNote)
    {
        this.checkDomainID();
        Session["Lang"] = bzLang.checkLang(Request.QueryString["Lang"] == null ? Session["Lang"].ToString() : Request.QueryString["Lang"]);
        _Act = string.IsNullOrEmpty(Request.QueryString["Act"]) ? "" : Request.QueryString["Act"];

        _CurrentLang = Session["Lang"].ToString().ToUpper().Trim();
        _SiteOption = new bzSiteOption(sSiteCate, sSiteNote).SiteOption;
        _Lang = new bzLang(Session["Lang"].ToString(), sLangNote).Lang;
    }
    private void checkDomainID()
    {
        object[] obj ={ 
            Request.QueryString["Page"],
            Request.QueryString["Limit"],
            Request.QueryString["ID"],
            Request.QueryString["CateID"]
        };
        if (!bzStringClass.checkDomainID(obj))
        {
            Response.Redirect(bzStringClass.ErrorPage);
        }

    }
    //----------------------------------------------------------------------------------
	public bzMasterPageBase()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
    }
}
